--- title: "2、奇特密码" created: 2025-11-28 tags: - 算法 --- # 2、奇特密码 ## 题目 [鸡哥的奇特密码](https://www.lanqiao.cn/problems/4125/learning/) ![[image-11ed6ec0.png]] ## 思路分析 任意连续的两个L会合成一个L LLL → LL → L 其实只要是连续的L都会变成一个L 所以只需要输出第一个L 如何判断是不是第一个L ——左边没元素或者左边是Q ## 代码实现 ```cpp #include using namespace std; #define endl '\n' int main() { ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); string s;cin>>s; for(int i=0;i